-
Notifications
You must be signed in to change notification settings - Fork 227
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Resource: Add LBAC for datasources data_source_lbac_rules
#1797
Open
eleijonmarck
wants to merge
10
commits into
main
Choose a base branch
from
eleijonmarck/lbac-for-datasources/bulk-api
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
In order to lower resource usage and have a faster runtime, PRs will not run Cloud tests automatically. |
eleijonmarck
changed the title
[WIP]: LBAC for datasources
Resource: LBAC for datasources Sep 17, 2024
data_source_lbac_rules
eleijonmarck
changed the title
Resource: LBAC for datasources
Resource: Add LBAC for datasources Sep 17, 2024
data_source_lbac_rules
data_source_lbac_rules
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
why/what
We have seen that users would love to provision their lbac rules using terraform. this implements a experimental feature that will be highly developed. this is the first part of LBAC rules resource for terraform.
we have:
updated swagger doc and swagger definitions in LBAC for datasources
ability to run
terraform plan, terraform apply and terraform destroy of the rules resource
Example terraform:
proposals and thought process
there is no ID for the json field
teamHttpHeaders
data_source_config
resource morethis is a resource that will be heavily used
grafana_data_source_permission_item
for this. as it suits well for how we would like to setup this resourceresource_data_source_config_lbac_rules
proposal of all rules combined into one resource
benefits
tradeoffs
proposal of each rule being a resource
benefits
tradeoffs
proposal of embedding it into a resource and then add it to the json
benefits:
tradeoff
It's a tradeoff of where you want the complexity to be. In Grafana with a new way to store this, or in the provider extracting it from json data, and possibly running into versioning issues.
I guess the less complex option is to leave everything as-is, isn't it? Have people manage those new fields in the existing json data? Perhaps provide a datasource helper for this, if the value is not trivial to build/represent
run tests via
GRAFANA_VERSION=11.1.0 GRAFANA_URL=http://localhost:3000 GRAFANA_AUTH=admin:admin TESTARGS="-run TestAccDataSourceLBAC_inOrg" make testacc-enterprise
The
teamHttpHeaders
resource is a datasource json field.epic
basically this introduced a way to add/update a datasource json field
lbac-api
here is the doc for it. https://grafana.com/docs/grafana/latest/administration/data-source-management/teamlbac/
next steps
improvements: